package com.example.EatOnTrojans;

import com.example.EatOnTrojans.R;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.content.Intent;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;

import android.widget.ImageView;


public class EatOnTrojansActivity extends Activity {
	
	private ImageView search;
	private ImageView map;
	private ImageView list;
	private ImageView like;
	private ProgressDialog progressDialog;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        search = (ImageView) findViewById(R.id.search);
        map = (ImageView) findViewById(R.id.map);
        list = (ImageView) findViewById(R.id.list);
        like = (ImageView) findViewById(R.id.like);
        
        
        search.setOnClickListener(new OnClickListener(){
        	public void onClick(View v){
        		
        		Bundle data = new Bundle();
                Intent intent = new Intent(EatOnTrojansActivity.this,Search.class);
                intent.putExtras(data);
                startActivity(intent);
        	}
        });
        
        list.setOnClickListener(new OnClickListener(){
        	public void onClick(View v){
        		progressDialog = new ProgressDialog(EatOnTrojansActivity.this);
        		progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        		progressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        		progressDialog.setMessage("Loading list...");
        		progressDialog.show();  
        		
        		Bundle data = new Bundle();
                Intent intent = new Intent(EatOnTrojansActivity.this,List.class);
                intent.putExtras(data);
                startActivity(intent);
        	}
        });
        
        
        map.setOnClickListener(new OnClickListener(){
			@Override
			public void onClick(View v){
				progressDialog = new ProgressDialog(EatOnTrojansActivity.this);
        		progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
        		progressDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        		progressDialog.setMessage("Getting current location...");
        		progressDialog.show();  
				//Toast.makeText(getApplicationContext(), "click the image",Toast.LENGTH_SHORT).show();
				Intent intent = new Intent();
				intent.setClass(EatOnTrojansActivity.this, GoogleMapsActivity.class);
				EatOnTrojansActivity.this.startActivity(intent);
			}
		});
        
        like.setOnClickListener(new OnClickListener(){
        	public void onClick(View v){

                Intent intent = new Intent(EatOnTrojansActivity.this, Help.class);
                EatOnTrojansActivity.this.startActivity(intent);
        	}
        });
    }
}